// !#1 都可以描述对象和函数
// 接口描述对象和函数
/* interface IPerson {
  name: string;
  age: number
}
const o: IPerson = { name: 'ifer', age: 18 }

interface ISum {
  (a: number, b: number): number
}
const sum: ISum = (a, b) => a + b */

// type 描述对象和函数
/* type IPerson = {
  name: string;
  age: number
}
const o: IPerson = { name: 'ifer', age: 18 }

type ISum = {
  (a: number, b: number): number
}
const sum: ISum = (a, b) => a + b */

// !#2 都允许拓展类型，语法不一样，interface 通过 extends 关键字，type 通过 & 符号形成联合类型
/* interface IName {
  name: string
}
interface IPerson extends IName {
  age: number
}
const p: IPerson = {
  name: 'ifer',
  age: 18,
} */

/* type TName = {
  name: string
}
type TPerson = TName & { age: number }
const p: TPerson = {
  name: 'ifer',
  age: 18,
} */

export { }